<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>ROSS: core/clock/amd64.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <a href="https://github.com/ROSS-org/ROSS">
   <div id="projectname">ROSS
   </div>
   </a>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_af18cf245e3394ab3b436135935cfd6e.html">core</a></li><li class="navelem"><a class="el" href="dir_6924c9c6e6f381ea7419166e601197d9.html">clock</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">amd64.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="amd64_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef INC_clock_amd64</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define INC_clock_amd64</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00004"></a><span class="lineno"><a class="line" href="amd64_8h.html#abcd6b97b84bebf1f961f85cd24b56c60">    4</a></span>&#160;<span class="keyword">typedef</span> uint64_t <a class="code" href="amd64_8h.html#abcd6b97b84bebf1f961f85cd24b56c60">tw_clock</a>;</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;</div>
<div class="line"><a name="l00006"></a><span class="lineno"><a class="line" href="amd64_8h.html#a450cf25fa5291629087ca4198de55757">    6</a></span>&#160;<span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="aarch64_8h.html#abcd6b97b84bebf1f961f85cd24b56c60">tw_clock</a>  <a class="code" href="amd64_8h.html#a450cf25fa5291629087ca4198de55757">tw_clock_read</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;{</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;        <a class="code" href="aarch64_8h.html#abcd6b97b84bebf1f961f85cd24b56c60">tw_clock</a> result=0;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#ifdef ROSS_timing</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor"></span>        <span class="keywordtype">unsigned</span> a, d; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;        <span class="keywordflow">do</span> {</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;                __asm__ __volatile__(<span class="stringliteral">&quot;rdtsc&quot;</span> : <span class="stringliteral">&quot;=a&quot;</span> (a), <span class="stringliteral">&quot;=d&quot;</span> (d)); </div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;                result = ((uint64_t)a) | (((uint64_t)d) &lt;&lt; 32);</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;        } <span class="keywordflow">while</span> (__builtin_expect ((<span class="keywordtype">int</span>) result == -1, 0));</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor"></span>        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;}</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="amd64_8h_html_abcd6b97b84bebf1f961f85cd24b56c60"><div class="ttname"><a href="amd64_8h.html#abcd6b97b84bebf1f961f85cd24b56c60">tw_clock</a></div><div class="ttdeci">uint64_t tw_clock</div><div class="ttdef"><b>Definition:</b> <a href="amd64_8h_source.html#l00004">amd64.h:4</a></div></div>
<div class="ttc" id="aarch64_8h_html_abcd6b97b84bebf1f961f85cd24b56c60"><div class="ttname"><a href="aarch64_8h.html#abcd6b97b84bebf1f961f85cd24b56c60">tw_clock</a></div><div class="ttdeci">uint64_t tw_clock</div><div class="ttdef"><b>Definition:</b> <a href="aarch64_8h_source.html#l00004">aarch64.h:4</a></div></div>
<div class="ttc" id="amd64_8h_html_a450cf25fa5291629087ca4198de55757"><div class="ttname"><a href="amd64_8h.html#a450cf25fa5291629087ca4198de55757">tw_clock_read</a></div><div class="ttdeci">static tw_clock tw_clock_read(void)</div><div class="ttdef"><b>Definition:</b> <a href="amd64_8h_source.html#l00006">amd64.h:6</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>
